<template>
  <view class="video-card">
    <view class="video-container">
      <image class="video-preview" :src="video.videoUrl" mode="aspectFill" />
      <view class="play-btn">▶️</view>
    </view>
    
    <view class="video-info">
      <view class="author-info">
        <image class="author-avatar" :src="video.avatar" mode="aspectFill" />
        <view class="author-details">
          <text class="author-name">{{ video.author }}</text>
          <text class="video-title">{{ video.title }}</text>
        </view>
      </view>
      
      <view class="video-description">{{ video.description }}</view>
      
      <view class="video-actions">
        <view class="action-btn" :class="{ liked: video.isLiked }" @click="handleLike">
          <text class="action-icon">{{ video.isLiked ? '❤️' : '🤍' }}</text>
          <text class="action-text">{{ video.likes }}</text>
        </view>
        <view class="action-btn" @click="handleComment">
          <text class="action-icon">💬</text>
          <text class="action-text">{{ video.comments }}</text>
        </view>
        <view class="action-btn" @click="handleShare">
          <text class="action-icon">📤</text>
          <text class="action-text">{{ video.shares }}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
defineProps({
  video: {
    type: Object,
    required: true
  }
})

const emit = defineEmits(['like', 'comment', 'share'])

const handleLike = () => {
  emit('like', props.video.id)
}

const handleComment = () => {
  emit('comment', props.video.id)
}

const handleShare = () => {
  emit('share', props.video.id)
}
</script>

<style scoped>
.video-card {
  height: 100vh;
  background: #000;
  position: relative;
}
.video-container {
  position: relative;
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-preview {
  width: 100%;
  height: 100%;
}
.play-btn {
  position: absolute;
  font-size: 80rpx;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 120rpx;
  height: 120rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 40rpx 30rpx 120rpx;
  color: #fff;
}
.author-info {
  display: flex;
  align-items: center;
  margin-bottom: 20rpx;
}
.author-avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 40rpx;
  margin-right: 20rpx;
  border: 2rpx solid rgba(255, 255, 255, 0.3);
}
.author-details {
  flex: 1;
}
.author-name {
  font-size: 26rpx;
  color: #fff;
  margin-bottom: 8rpx;
  display: block;
}
.video-title {
  font-size: 28rpx;
  font-weight: bold;
  color: #fff;
  display: block;
}
.video-description {
  font-size: 24rpx;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30rpx;
  line-height: 1.4;
}
.video-actions {
  display: flex;
  gap: 40rpx;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.action-icon {
  font-size: 40rpx;
  margin-bottom: 8rpx;
}
.action-text {
  font-size: 22rpx;
  color: rgba(255, 255, 255, 0.8);
}
.action-btn.liked .action-text {
  color: #ff6b35;
}
</style>
